// ==UserScript==
// @include	   http://*.imvu.com/shop/product.php?products_id=*
// ==/UserScript==
window.addEventListener('DOMContentLoaded', function() {
     if ( widget.preferences.prodt == "enabled" ){
	var css = '#myimfuprodt{font-size:12px!important;padding:5px!important;position:fixed!important;top:30px!important;right:2px!important;background:grey!important;display:inline!important;border:1px solid #000!important;border-radius:5px!important;z-index:9999999!important;}#myimfuprodt a{color:#000!important;font-size:12px!important;text-decoration:none!important}#myimfuprodt a:hover{color:#fff!important}';
	var imvunamedlink = document.createElement("span");
	imvunamedlink.setAttribute('id', 'myimfuprodt');
	imvunamedlink.innerHTML = '<a href=\'javascript:var addy=document.location.href;var prodnum=addy.substr(addy.indexOf("?")+13);window.location="http://www.imvu.com/shop/web_search.php?derived_from="+prodnum\'>Derived From</a><br><a href=\'javascript:var addy=document.location.href;var prodnum=addy.substr(addy.indexOf("?")+13);window.location="http://www.imvu.com/shop/derivation_tree.php?products_id="+prodnum\'>View Derivation Tree</a><br><br><a href=\'javascript:var addy=document.location.href;var prodnum=addy.substr(addy.indexOf("?")+13);window.location="http://www.imvu.com/catalog/web_submit_product.php?submit_type=edit_product&edit_pid="+prodnum\'>Edit Product Settings</a><br><a href=\'javascript:var addy=document.location.href;var prodnum=addy.substr(addy.indexOf("?")+13);window.location="http://www.imvu.com/catalog/developer_report.php?reporttype=productinfo&product_id="+prodnum\'>Product Report</a><br>';
	var imfubody = document.getElementsByTagName("body")[0];
	imfubody.appendChild(imvunamedlink);
	var heads = document.getElementsByTagName("head");
	if (heads.length > 0) {
	var node = document.createElement("style");
	node.type = "text/css";
	node.appendChild(document.createTextNode(css));
	heads[0].appendChild(node); 
	}}
}, true);
